$().ready(function () {
    $("#logout").click(function () {
        $.ajax({
            type: "POST",
            url: "/index.php?m=home&c=user&a=logout",
            dataType: 'JSON',
            data:{
                'access_token':tool.cookie('access_token'),
            },
            success: function(data){
                if(data.errno == "0") {
                   layer.msg('退出成功');
                   //window.location.href = "/index.php?m=home&c=Index&a=index";
                }else{
                    layer.msg('退出失败')
                }
            },
            error: function(XMLHttpRequest, textStatus, errorThrown){
            }
        });
        return false;
    })
})